<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="author" content="esy">
    
    <meta name="description" content="esy">
    
    
    
    
    
    
    <title>对UCDDB数据库进行特征提取 | ESY</title>
    <link href="https://esyyes.github.io" rel="prefetch" />

    
<link rel="stylesheet" href="/css/bootstrap.min.css">
<link rel="stylesheet" href="/css/aos.css">
<link rel="stylesheet" href="/css/style.css">

    
<script src="/js/jquery.min.js"></script>

    
<script src="/js/bootstrap.min.js"></script>

    
<script src="/js/aos.js"></script>

    
<script src="/js/highslide/highslide-full.min.js"></script>

    
<link rel="stylesheet" href="/js/highslide/highslide.css">

    <style type="text/css">
        @media (max-width: 768px) {
            body {
                background-color: #f0f0f0;
                background: url('/imgs/xsbg.gif');
                background-attachment: fixed;
            }
        }
    </style>
    
    <!--<script type="text/javascript">
      if (document.images) {
        var avatar = new Image();
        avatar.src = '/imgs/avatar.jpg'
        var previews = 'preview1.jpg,preview2.jpg,preview3.jpg,preview4.jpg'.split(',')
        var previewsPreLoad = []
        for(var i = 0; i < length; i++) {
          previewsPreLoad.push(new Image())
          previewsPreLoad[previewsPreLoad.length - 1].src = '/imgs/preview' + previews[i]
        }
      }
    </script>-->
<meta name="generator" content="Hexo 5.2.0"></head>
<body>
    <!-- 背景轮播图功能 -->
    <section class="hidden-xs">
    <ul class="cb-slideshow">
        <li><span>天若</span></li>
        <li><span>有情</span></li>
        <li><span>天亦老</span></li>
        <li><span>我为</span></li>
        <li><span>长者</span></li>
        <li><span>续一秒</span></li>
    </ul>
</section>
    <!-- 欧尼酱功能, 谁用谁知道 -->
    
    <div class="gal-menu gal-dropdown">
    <div class="circle" id="gal">
        <div class="ring">
            <a href="https://esyyes.github.io" class="menuItem" style="left: 50%; top: 15%;">首页</a>
            
            <a class="menuItem" style="left: 80.3109%; top: 32.5%;">下一页</a>
            
            <a href="/archives" class="menuItem" style="left: 80.3109%; top: 67.5%;">归档</a>
            <a href="/about" class="menuItem" style="left: 50%; top: 85%;">关于</a>
            <a href="/message" class="menuItem" style="left: 19.6891%; top: 67.5%;">留言板</a>

            
            <a class="menuItem" style="left: 19.6891%; top: 32.5%;">上一页</a>
            
        </div>
        <audio id="audio" src="/imgs/oni.mp3"></audio>
    </div>
</div>
    
    <header class="navbar navbar-inverse" id="gal-header">
    <div class="container">
        <div class="navbar-header">
            <button type="button" class="navbar-toggle collapsed"
                    data-toggle="collapse" data-target=".bs-navbar-collapse"
                    aria-expanded="false">
                <span class="fa fa-lg fa-reorder"></span>
            </button>
            <a href="https://esyyes.github.io">
                
                <style>
                    #gal-header .navbar-brand {
                        height: 54px;
                        line-height: 24px;
                        font-size: 28px;
                        opacity: 1;
                        background-color: rgba(0,0,0,0);
                        text-shadow: 0 0 5px #fff,0 0 10px #fff,0 0 15px #fff,0 0 20px #228DFF,0 0 35px #228DFF,0 0 40px #228DFF,0 0 50px #228DFF,0 0 75px #228DFF;
                    }
                </style>
                <!-- 这里使用文字(navbar_text or config.title) -->
                <div class="navbar-brand">ESY</div>
                
            </a>
        </div>
        <div class="collapse navbar-collapse bs-navbar-collapse">
            <ul class="nav navbar-nav" id="menu-gal">
                
                
                <li class="">
                    <a href="/">
                        <i class="fa fa-home"></i>首页
                    </a>
                </li>
                
                
                
                <li class="">
                    <a href="/archives">
                        <i class="fa fa-archive"></i>归档
                    </a>
                </li>
                
                
                
                
                <li class="dropdown">
                    <!-- TODO 添加hover dropdown效果 -->
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown"
                       aria-haspopup="true" aria-expanded="false" data-hover="dropdown">
                        <i class="fa fa-list"></i>分类
                    </a>
                    <ul class="dropdown-menu">
                        
                        
                        <li>
                            <a href="/categories/py-study/">py_study</a>
                        </li>
                        
                        <li>
                            <a href="/categories/nlp/">nlp</a>
                        </li>
                        
                        <li>
                            <a href="/categories/Graduation-work/">Graduation work</a>
                        </li>
                        
                        <li>
                            <a href="/categories/work/">work</a>
                        </li>
                        
                        <li>
                            <a href="/categories/hexo/">hexo</a>
                        </li>
                        
                        <li>
                            <a href="/categories/hexo%E5%AE%8C%E5%96%84/">-hexo完善</a>
                        </li>
                        
                        
                        <li>
                            <a href="/categories">...</a>
                        </li>
                        
                        
                    </ul>
                </li>
                
                
                
                
                
                <li class="dropdown">
                    <!-- TODO 添加hover dropdown效果 -->
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown"
                       aria-haspopup="true" aria-expanded="false" data-hover="dropdown">
                        <i class="fa fa-tags"></i>标签
                    </a>
                    <ul class="dropdown-menu">
                        
                        
                        <li>
                            <a href="/tags/py-study/">py_study</a>
                        </li>
                        
                        <li>
                            <a href="/tags/nlp/">nlp</a>
                        </li>
                        
                        <li>
                            <a href="/tags/Graduation-work/">Graduation work</a>
                        </li>
                        
                        <li>
                            <a href="/tags/work/">work</a>
                        </li>
                        
                        <li>
                            <a href="/tags/hexo/">hexo</a>
                        </li>
                        
                        <li>
                            <a href="/tags/%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2%E6%90%AD%E5%BB%BA/">-个人博客搭建</a>
                        </li>
                        
                        
                        <li>
                            <a href="/tags">...</a>
                        </li>
                        
                        
                    </ul>
                </li>
                
                
                
                
                <li class="">
                    <a href="/about">
                        <i class="fa fa-user"></i>关于我
                    </a>
                </li>
                
                
            </ul>
        </div>
    </div>
</header>
    <div id="gal-body">
        <div class="container">
            <div class="row">
                <div class="col-md-8 gal-right" id="mainstay">
                    
<article class="article well article-body" id="article">
    <div class="breadcrumb">
        <i class="fa fa-home"></i>
        <a href="https://esyyes.github.io">ESY</a>
        >
        <span>对UCDDB数据库进行特征提取</span>
    </div>
    <!-- 大型设备详细文章 -->
    <div class="hidden-xs">
        <div class="title-article">
            <h1>
                <a href="/2020/08/19/python%20work/%E5%AF%B9UCDDB%E6%95%B0%E6%8D%AE%E5%BA%93%E8%BF%9B%E8%A1%8C%E7%89%B9%E5%BE%81%E6%8F%90%E5%8F%96/">对UCDDB数据库进行特征提取</a>
            </h1>
        </div>
        <div class="tag-article">
            
            <span class="label label-gal">
                <i class="fa fa-tags"></i>
                
                <a href="/tags/work/">work</a>
                
            </span>
            
            <span class="label label-gal">
                <i class="fa fa-calendar"></i> 2020-08-19
            </span>
            
        </div>
    </div>
    <!-- 小型设备详细文章 -->
    <div class="visible-xs">
        <center>
            <div class="title-article">
                <h4>
                    <a href="/2020/08/19/python%20work/%E5%AF%B9UCDDB%E6%95%B0%E6%8D%AE%E5%BA%93%E8%BF%9B%E8%A1%8C%E7%89%B9%E5%BE%81%E6%8F%90%E5%8F%96/">对UCDDB数据库进行特征提取</a>
                </h4>
            </div>
            <p>
                <i class="fa fa-calendar"></i> 2020-08-19
            </p>
            <p>
                
                <i class="fa fa-tags"></i>
                
                <a href="/tags/work/">work</a>
                
                
                
            </p>
        </center>
    </div>
    <div class="content-article">
        <h1 id="对UCDDB数据库进行特征提取"><a href="#对UCDDB数据库进行特征提取" class="headerlink" title="对UCDDB数据库进行特征提取"></a>对UCDDB数据库进行特征提取</h1><p>ucddb数据库</p>
<p>fs = 128</p>
<p>首先先读取数据，然后再矫正数据</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># -*- coding: utf-8 -*-</span></span><br><span class="line"><span class="comment"># @Time     : 2020/8/19</span></span><br><span class="line"><span class="comment"># @Author   : esy</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="comment"># RR峰值点获取</span></span><br><span class="line"><span class="keyword">import</span> matplotlib.pyplot <span class="keyword">as</span> plt</span><br><span class="line"><span class="keyword">import</span> numpy <span class="keyword">as</span> np</span><br><span class="line"><span class="keyword">import</span> scipy.io <span class="keyword">as</span> scio</span><br><span class="line"><span class="keyword">import</span> pandas <span class="keyword">as</span> pd</span><br><span class="line"><span class="keyword">from</span> wfdb <span class="keyword">import</span> processing</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="comment"># Use the gqrs detection algorithm and correct the peaks</span></span><br><span class="line"></span><br><span class="line"><span class="function"><span class="keyword">def</span> <span class="title">peaks_hr</span>(<span class="params">sig, peak_inds, fs, title, figsize=(<span class="params"><span class="number">20</span>, <span class="number">10</span></span>), saveto=<span class="literal">None</span></span>):</span></span><br><span class="line">    <span class="string">&quot;Plot a signal with its peaks and heart rate&quot;</span></span><br><span class="line">    <span class="comment"># Calculate heart rate</span></span><br><span class="line">    hrs = processing.compute_hr(sig_len=sig.shape[<span class="number">0</span>], qrs_inds=peak_inds, fs=fs)</span><br><span class="line"></span><br><span class="line">    N = sig.shape[<span class="number">0</span>]</span><br><span class="line"></span><br><span class="line">    fig, ax_left = plt.subplots(figsize=figsize)</span><br><span class="line">    ax_right = ax_left.twinx()</span><br><span class="line"></span><br><span class="line">    ax_left.plot(sig, color=<span class="string">&#x27;#3979f0&#x27;</span>, label=<span class="string">&#x27;Signal&#x27;</span>)</span><br><span class="line">    ax_left.plot(peak_inds, sig[peak_inds], <span class="string">&#x27;rx&#x27;</span>, marker=<span class="string">&#x27;x&#x27;</span>, color=<span class="string">&#x27;#8b0000&#x27;</span>, label=<span class="string">&#x27;Peak&#x27;</span>, markersize=<span class="number">12</span>)</span><br><span class="line">    <span class="comment">#     ax_right.plot(np.arange(N), hrs, label=&#x27;Heart rate&#x27;, color=&#x27;m&#x27;, linewidth=2)</span></span><br><span class="line">    <span class="comment"># 不要心率这一指标，后面再加</span></span><br><span class="line">    ax_left.set_title(title)</span><br><span class="line"></span><br><span class="line">    ax_left.set_xlabel(<span class="string">&#x27;Time (ms)&#x27;</span>)</span><br><span class="line">    ax_left.set_ylabel(<span class="string">&#x27;ECG (mV)&#x27;</span>, color=<span class="string">&#x27;#3979f0&#x27;</span>)</span><br><span class="line">    <span class="comment">#     ax_right.set_ylabel(&#x27;Heart rate (bpm)&#x27;, color=&#x27;m&#x27;)</span></span><br><span class="line">    <span class="comment"># Make the y-axis label, ticks and tick labels match the line color.</span></span><br><span class="line">    ax_left.tick_params(<span class="string">&#x27;y&#x27;</span>, colors=<span class="string">&#x27;#3979f0&#x27;</span>)</span><br><span class="line">    ax_right.tick_params(<span class="string">&#x27;y&#x27;</span>, colors=<span class="string">&#x27;m&#x27;</span>)</span><br><span class="line">    <span class="keyword">if</span> saveto <span class="keyword">is</span> <span class="keyword">not</span> <span class="literal">None</span>:</span><br><span class="line">        plt.savefig(saveto, dpi=<span class="number">600</span>)</span><br><span class="line">    plt.show()</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="comment"># Load the wfdb record and the physical samples</span></span><br><span class="line"><span class="comment"># 读取文件名</span></span><br><span class="line">text_name = pd.read_excel(<span class="string">&#x27;F:/st_data/SubjectDetails.xls&#x27;</span>)</span><br><span class="line">study_name = np.array(text_name[<span class="string">&#x27;Study Number&#x27;</span>])</span><br><span class="line"></span><br><span class="line"><span class="comment"># 读取文件对应的数据</span></span><br><span class="line">dataFile = <span class="string">&#x27;F:/st_data/&#x27;</span> + study_name[<span class="number">0</span>] + <span class="string">&#x27;.mat&#x27;</span></span><br><span class="line">data = scio.loadmat(dataFile)[<span class="string">&#x27;signal&#x27;</span>]</span><br><span class="line"></span><br><span class="line"><span class="comment"># Use the gqrs algorithm to detect qrs locations in the first channel</span></span><br><span class="line">qrs_inds = processing.gqrs_detect(sig=data[:, <span class="number">0</span>], fs=<span class="number">128</span>)</span><br><span class="line"></span><br><span class="line"><span class="comment"># Plot results</span></span><br><span class="line">peaks_hr(sig=data, peak_inds=qrs_inds, fs=<span class="number">128</span>, title=<span class="string">&quot;GQRS peak detection on record slp01a&quot;</span>)</span><br><span class="line"></span><br><span class="line"><span class="comment"># Correct the peaks shifting them to local maxima</span></span><br><span class="line">min_bpm = <span class="number">40</span></span><br><span class="line">max_bpm = <span class="number">200</span></span><br><span class="line"><span class="comment"># min_gap = record.fs * 60 / min_bpm</span></span><br><span class="line"><span class="comment"># Use the maximum possible bpm as the search radius</span></span><br><span class="line">search_radius = <span class="built_in">int</span>(<span class="number">128</span> * <span class="number">60</span> / max_bpm)</span><br><span class="line">corrected_peak_inds = processing.correct_peaks(data[:, <span class="number">0</span>], peak_inds=qrs_inds,</span><br><span class="line">                                               search_radius=search_radius, smooth_window_size=<span class="number">150</span>)</span><br><span class="line"></span><br><span class="line"><span class="comment"># Display results</span></span><br><span class="line">print(<span class="string">&#x27;Corrected gqrs detected peak indices:&#x27;</span>, <span class="built_in">sorted</span>(corrected_peak_inds))</span><br><span class="line">peaks_hr(sig=data, peak_inds=<span class="built_in">sorted</span>(corrected_peak_inds), fs=<span class="number">128</span>,</span><br><span class="line">         title=<span class="string">&quot;Corrected GQRS peak detection on slp01a&quot;</span>)</span><br><span class="line"></span><br></pre></td></tr></table></figure>

<p>所以现在有了正确的波峰值</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">for</span> j <span class="keyword">in</span> <span class="built_in">range</span>(<span class="number">11</span>, <span class="built_in">len</span>(ecg_r_locs)):</span><br><span class="line">    <span class="keyword">if</span> (<span class="number">30</span>*record.fs*i) &lt;= ecg_r_locs[j] &lt;= (<span class="number">30</span>*record.fs*(i+<span class="number">10</span>)):</span><br><span class="line">        locs_300s.append(ecg_r_locs[j])</span><br><span class="line">        RR_300s.append((ecg_r_locs[j+<span class="number">1</span>] - ecg_r_locs[j]) * <span class="number">4</span>)</span><br><span class="line">        peaks_300s.append(ecg_r_peaks[j])</span><br><span class="line">    <span class="keyword">else</span>:</span><br><span class="line">        <span class="keyword">pass</span></span><br><span class="line">RR_300s.pop()</span><br></pre></td></tr></table></figure>

<p>j为啥是从11开始！！！</p>
<p>可以从11开始，因为原始的数据if (30<em>record.fs</em>i) &lt;= ecg_r_locs[j] &lt;= (30<em>record.fs</em>(i+10)):这个值不是从0开始的，但是有些数据是从0开始的，为了不再次运行，因此决定删除所有特征和注释的第一行。</p>
<p>到时候把特征提取这些全部重新做一遍</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># -*- coding: utf-8 -*-</span></span><br><span class="line"><span class="comment"># @Time     : 2020/8/20</span></span><br><span class="line"><span class="comment"># @Author   : esy</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">import</span> pandas <span class="keyword">as</span> pd</span><br><span class="line"><span class="keyword">import</span> warnings</span><br><span class="line"></span><br><span class="line">warnings.filterwarnings(<span class="string">&quot;ignore&quot;</span>)</span><br><span class="line"></span><br><span class="line"><span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(<span class="number">1</span>, <span class="number">19</span>):</span><br><span class="line">    feature = pd.read_excel(<span class="string">&#x27;F:/py/python-ECG信号处理/all_feature&#x27;</span> + <span class="string">&#x27;/features&#x27;</span> + <span class="string">&#x27;%s&#x27;</span> % i + <span class="string">&#x27;.xlsx&#x27;</span>)</span><br><span class="line">    data = pd.get_dummies(feature.iloc[<span class="number">0</span>:<span class="built_in">len</span>(feature), <span class="number">1</span>:])</span><br><span class="line">    删除dataframe中的指定一行</span><br><span class="line">    data.drop(data.index[[<span class="number">0</span>]], inplace=<span class="literal">True</span>)</span><br><span class="line">    data.to_excel(<span class="string">&#x27;features&#x27;</span> + <span class="string">&#x27;%s&#x27;</span> % i + <span class="string">&#x27;.xlsx&#x27;</span>)</span><br><span class="line">    note = pd.read_excel(<span class="string">&#x27;F:/py/python-ECG信号处理/all_note&#x27;</span> + <span class="string">&#x27;/note&#x27;</span> + <span class="string">&#x27;%s&#x27;</span> % i + <span class="string">&#x27;.xlsx&#x27;</span>)</span><br><span class="line">    tag = pd.get_dummies(note.iloc[<span class="number">0</span>:<span class="built_in">len</span>(data), <span class="number">1</span>:])</span><br><span class="line">    tag.drop(tag.index[[<span class="number">0</span>]], inplace=<span class="literal">True</span>)</span><br><span class="line">    tag.to_excel(<span class="string">&#x27;note&#x27;</span> + <span class="string">&#x27;%s&#x27;</span> % i + <span class="string">&#x27;.xlsx&#x27;</span>)</span><br></pre></td></tr></table></figure>

<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br><span class="line">93</span><br><span class="line">94</span><br><span class="line">95</span><br><span class="line">96</span><br><span class="line">97</span><br><span class="line">98</span><br><span class="line">99</span><br><span class="line">100</span><br><span class="line">101</span><br><span class="line">102</span><br><span class="line">103</span><br><span class="line">104</span><br><span class="line">105</span><br><span class="line">106</span><br><span class="line">107</span><br><span class="line">108</span><br><span class="line">109</span><br><span class="line">110</span><br><span class="line">111</span><br><span class="line">112</span><br><span class="line">113</span><br><span class="line">114</span><br><span class="line">115</span><br><span class="line">116</span><br><span class="line">117</span><br><span class="line">118</span><br><span class="line">119</span><br><span class="line">120</span><br><span class="line">121</span><br><span class="line">122</span><br><span class="line">123</span><br><span class="line">124</span><br><span class="line">125</span><br><span class="line">126</span><br><span class="line">127</span><br><span class="line">128</span><br><span class="line">129</span><br><span class="line">130</span><br><span class="line">131</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># -*- coding: utf-8 -*-</span></span><br><span class="line"><span class="comment"># @Time     : 2020/8/20</span></span><br><span class="line"><span class="comment"># @Author   : esy</span></span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="keyword">import</span> scipy.io <span class="keyword">as</span> scio</span><br><span class="line"><span class="keyword">import</span> pandas <span class="keyword">as</span> pd</span><br><span class="line"><span class="keyword">from</span> wfdb <span class="keyword">import</span> processing</span><br><span class="line"><span class="comment"># import numpy as np</span></span><br><span class="line"><span class="keyword">import</span> warnings</span><br><span class="line"><span class="keyword">from</span> peaks_time_features <span class="keyword">import</span> *</span><br><span class="line"><span class="keyword">from</span> time_domain <span class="keyword">import</span> *</span><br><span class="line"><span class="keyword">from</span> frequency_domain <span class="keyword">import</span> *</span><br><span class="line"><span class="keyword">from</span> nonliner_domain <span class="keyword">import</span> *</span><br><span class="line"><span class="keyword">from</span> eliminate_outliers <span class="keyword">import</span> *</span><br><span class="line"><span class="keyword">from</span> HRV_interp1 <span class="keyword">import</span> *</span><br><span class="line"></span><br><span class="line"></span><br><span class="line"><span class="comment"># 忽略警告</span></span><br><span class="line">warnings.filterwarnings(<span class="string">&quot;ignore&quot;</span>)</span><br><span class="line"></span><br><span class="line"><span class="comment"># 读取文件名</span></span><br><span class="line">text_name = pd.read_excel(<span class="string">&#x27;F:/st_data/SubjectDetails.xls&#x27;</span>)</span><br><span class="line">study_name = np.array(text_name[<span class="string">&#x27;Study Number&#x27;</span>])</span><br><span class="line"></span><br><span class="line"><span class="keyword">for</span> text <span class="keyword">in</span> study_name:</span><br><span class="line">    <span class="comment"># 读取文件对应的数据</span></span><br><span class="line">    dataFile = <span class="string">&#x27;F:/st_data/&#x27;</span> + <span class="string">&#x27;%s&#x27;</span> % text + <span class="string">&#x27;.mat&#x27;</span></span><br><span class="line">    data = scio.loadmat(dataFile)[<span class="string">&#x27;signal&#x27;</span>]</span><br><span class="line"></span><br><span class="line">    <span class="comment"># 利用GQRS算法获取R峰值</span></span><br><span class="line">    qrs_inds = processing.gqrs_detect(sig=data[:, <span class="number">0</span>], fs=<span class="number">128</span>)</span><br><span class="line">    <span class="comment"># 去寻找到正确的峰值点坐标</span></span><br><span class="line">    ecg_R_locs = processing.correct_peaks(data[:, <span class="number">0</span>], peak_inds=qrs_inds,</span><br><span class="line">                                          search_radius=<span class="built_in">int</span>(<span class="number">128</span> * <span class="number">60</span> / <span class="number">200</span>), smooth_window_size=<span class="number">100</span>)</span><br><span class="line">    <span class="comment"># ecg_r_locs异常点处理</span></span><br><span class="line">    ecg_r_locs = eliminate(ecg_R_locs)</span><br><span class="line">    <span class="comment"># ecg_r_peaks峰值点获取</span></span><br><span class="line">    ecg_r_peaks = [data[<span class="built_in">int</span>(ecg_r_locs[i])][<span class="number">0</span>] <span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(<span class="built_in">len</span>(ecg_r_locs))]</span><br><span class="line"></span><br><span class="line">    <span class="comment"># 获取5min时候的特征</span></span><br><span class="line">    all_RR_5m = []</span><br><span class="line">    all_locs_5m = []</span><br><span class="line">    all_peaks_5m = []</span><br><span class="line">    <span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(<span class="built_in">int</span>(<span class="built_in">len</span>(data)/<span class="number">128</span>/<span class="number">30</span> - <span class="number">11</span>)):</span><br><span class="line">        RR_300s = []</span><br><span class="line">        locs_300s = []</span><br><span class="line">        peaks_300s = []</span><br><span class="line">        <span class="keyword">for</span> j <span class="keyword">in</span> <span class="built_in">range</span>(<span class="built_in">len</span>(ecg_r_locs)):</span><br><span class="line">            <span class="keyword">if</span> (<span class="number">30</span>*<span class="number">128</span>*i) &lt;= ecg_r_locs[j] &lt;= (<span class="number">30</span>*<span class="number">128</span>*(i+<span class="number">10</span>)):</span><br><span class="line">                locs_300s.append(ecg_r_locs[j])</span><br><span class="line">                RR_300s.append((ecg_r_locs[j+<span class="number">1</span>] - ecg_r_locs[j]) * <span class="number">4</span>)</span><br><span class="line">                peaks_300s.append(ecg_r_peaks[j])</span><br><span class="line">            <span class="keyword">else</span>:</span><br><span class="line">                <span class="keyword">pass</span></span><br><span class="line">        RR_300s.pop()</span><br><span class="line">        all_RR_5m.append(RR_300s)</span><br><span class="line">        all_locs_5m.append(locs_300s)</span><br><span class="line">        all_peaks_5m.append(peaks_300s)</span><br><span class="line"></span><br><span class="line">    <span class="comment"># ECG_R</span></span><br><span class="line">    peaks_features = [peaks_time_feature(all_peaks_5m[i]) <span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(<span class="built_in">len</span>(all_peaks_5m))]</span><br><span class="line">    <span class="comment"># HRV</span></span><br><span class="line">    hrv_time = [time_features(all_RR_5m[i]) <span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(<span class="built_in">len</span>(all_RR_5m))]</span><br><span class="line">    <span class="comment"># hrv_freq = [getfreq(resample(hrv_interp1(all_locs_5m[i], all_RR_5m[i], 10), 250, 4)) for i in range(len(all_RR_5m))]</span></span><br><span class="line">    hrv_freq = [getfreq(all_RR_5m[i]) <span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(<span class="built_in">len</span>(all_RR_5m))]</span><br><span class="line">    hrv_nonl = [non_linear5(np.array(all_RR_5m[i])) <span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(<span class="built_in">len</span>(all_RR_5m))]</span><br><span class="line">    features = [peaks_features[i] + hrv_time[i] + hrv_freq[i] + hrv_nonl[i] <span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(<span class="built_in">len</span>(all_RR_5m))]</span><br><span class="line"></span><br><span class="line">    all_RR_30s = []</span><br><span class="line">    all_locs_30s = []</span><br><span class="line">    all_peaks_30s = []</span><br><span class="line">    <span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(<span class="built_in">int</span>(<span class="built_in">len</span>(data)/<span class="number">128</span>/<span class="number">30</span> - <span class="number">1</span>)):</span><br><span class="line">        RR_30s = []</span><br><span class="line">        locs_30s = []</span><br><span class="line">        peaks_30s = []</span><br><span class="line">        <span class="keyword">for</span> j <span class="keyword">in</span> <span class="built_in">range</span>(<span class="built_in">len</span>(ecg_r_locs)):</span><br><span class="line">            <span class="keyword">if</span> (<span class="number">30</span> * <span class="number">128</span> * i) &lt;= ecg_r_locs[j] &lt;= (<span class="number">30</span> * <span class="number">128</span> * (i + <span class="number">1</span>)):</span><br><span class="line">                locs_30s.append(ecg_r_locs[j])</span><br><span class="line">                RR_30s.append((ecg_r_locs[j + <span class="number">1</span>] - ecg_r_locs[j]) * <span class="number">4</span>)</span><br><span class="line">                peaks_30s.append(ecg_r_peaks[j])</span><br><span class="line">            <span class="keyword">else</span>:</span><br><span class="line">                <span class="keyword">pass</span></span><br><span class="line">        RR_30s.pop()</span><br><span class="line">        all_RR_30s.append(RR_30s)</span><br><span class="line">        <span class="keyword">del</span> locs_30s[<span class="number">0</span>]</span><br><span class="line">        all_locs_30s.append(locs_30s)</span><br><span class="line">        all_peaks_30s.append(peaks_30s)</span><br><span class="line"></span><br><span class="line">    <span class="comment"># ECG_R</span></span><br><span class="line">    peaks_features1 = [peaks_time_feature(all_peaks_30s[i]) <span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(<span class="built_in">len</span>(all_peaks_30s))]</span><br><span class="line">    <span class="comment"># HRV</span></span><br><span class="line">    hrv_time1 = [time_features(all_RR_30s[i]) <span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(<span class="built_in">len</span>(all_RR_30s))]</span><br><span class="line">    hrv_freq1 = [getfreq(resample(hrv_interp1(all_locs_30s[i], all_RR_30s[i], <span class="number">1</span>), <span class="number">250</span>, <span class="number">4</span>)) <span class="keyword">for</span> i <span class="keyword">in</span></span><br><span class="line">                 <span class="built_in">range</span>(<span class="built_in">len</span>(all_RR_30s))]</span><br><span class="line">    hrv_nonl1 = [non_linear(np.array(all_RR_30s[i])) <span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(<span class="built_in">len</span>(all_RR_30s))]</span><br><span class="line">    features1 = [peaks_features1[i] + hrv_time1[i] + hrv_freq1[i] + hrv_nonl1[i] <span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(<span class="built_in">len</span>(all_RR_30s))]</span><br><span class="line">    features30 = features1[<span class="number">5</span>:(<span class="built_in">len</span>(features1) - <span class="number">5</span>)]</span><br><span class="line"></span><br><span class="line">    features50 = [features30[i] + features[i] <span class="keyword">for</span> i <span class="keyword">in</span> <span class="built_in">range</span>(<span class="built_in">len</span>(features))]</span><br><span class="line"></span><br><span class="line">    <span class="comment"># 保存为excel</span></span><br><span class="line">    feature = pd.DataFrame(features50, columns=[<span class="string">&#x27;p_max&#x27;</span>, <span class="string">&#x27;p_min&#x27;</span>, <span class="string">&#x27;p_mean&#x27;</span>, <span class="string">&#x27;p_median&#x27;</span>, <span class="string">&#x27;p_SDNN&#x27;</span>, <span class="string">&#x27;p_var&#x27;</span>,</span><br><span class="line">                                                <span class="string">&#x27;p_Peaks&#x27;</span>, <span class="string">&#x27;p_RMSSD&#x27;</span>, <span class="string">&#x27;p_kurt&#x27;</span>, <span class="string">&#x27;p_skew&#x27;</span>, <span class="string">&#x27;p_wave_factor&#x27;</span>,</span><br><span class="line">                                                <span class="string">&#x27;p_peak_factor&#x27;</span>, <span class="string">&#x27;p_Impulse_factor&#x27;</span>, <span class="string">&#x27;p_Margin_factor&#x27;</span>, <span class="string">&#x27;p_RMS&#x27;</span>,</span><br><span class="line">                                                <span class="string">&#x27;R_mean&#x27;</span>, <span class="string">&#x27;R_SDNN&#x27;</span>, <span class="string">&#x27;R_SDSD&#x27;</span>, <span class="string">&#x27;NN50&#x27;</span>, <span class="string">&#x27;pNN50&#x27;</span>, <span class="string">&#x27;NN20&#x27;</span>, <span class="string">&#x27;pNN20&#x27;</span>,</span><br><span class="line">                                                <span class="string">&#x27;R_RMSSD&#x27;</span>,</span><br><span class="line">                                                <span class="string">&#x27;R_median&#x27;</span>, <span class="string">&#x27;R_NUM&#x27;</span>, <span class="string">&#x27;R_CVSD&#x27;</span>, <span class="string">&#x27;R_CV&#x27;</span>, <span class="string">&#x27;HR_mean&#x27;</span>, <span class="string">&#x27;HR_max&#x27;</span>, <span class="string">&#x27;HR_min&#x27;</span>,</span><br><span class="line">                                                <span class="string">&#x27;HR_std&#x27;</span>,</span><br><span class="line">                                                <span class="string">&#x27;LF&#x27;</span>, <span class="string">&#x27;HF&#x27;</span>, <span class="string">&#x27;LF_HF&#x27;</span>, <span class="string">&#x27;LFnu&#x27;</span>, <span class="string">&#x27;HFnu&#x27;</span>, <span class="string">&#x27;total&#x27;</span>, <span class="string">&#x27;VLF&#x27;</span>, <span class="string">&#x27;sd1&#x27;</span>, <span class="string">&#x27;sd2&#x27;</span>,</span><br><span class="line">                                                <span class="string">&#x27;sd2/sd1&#x27;</span>,</span><br><span class="line">                                                <span class="string">&#x27;csi10&#x27;</span>, <span class="string">&#x27;cvi&#x27;</span>, <span class="string">&#x27;Modified_CSI10&#x27;</span>, <span class="string">&#x27;apen&#x27;</span>, <span class="string">&#x27;spen&#x27;</span>, <span class="string">&#x27;lle&#x27;</span>, <span class="string">&#x27;sampen&#x27;</span>,</span><br><span class="line"></span><br><span class="line">                                                <span class="string">&#x27;5p_max&#x27;</span>, <span class="string">&#x27;5p_min&#x27;</span>, <span class="string">&#x27;5p_mean&#x27;</span>, <span class="string">&#x27;5p_median&#x27;</span>, <span class="string">&#x27;5p_SDNN&#x27;</span>, <span class="string">&#x27;5p_var&#x27;</span>,</span><br><span class="line">                                                <span class="string">&#x27;5p_Peaks&#x27;</span>, <span class="string">&#x27;5p_RMSSD&#x27;</span>, <span class="string">&#x27;5p_kurt&#x27;</span>, <span class="string">&#x27;5p_skew&#x27;</span>, <span class="string">&#x27;5p_wave_factor&#x27;</span>,</span><br><span class="line">                                                <span class="string">&#x27;5p_peak_factor&#x27;</span>, <span class="string">&#x27;5p_Impulse_factor&#x27;</span>, <span class="string">&#x27;5p_Margin_factor&#x27;</span>, <span class="string">&#x27;5p_RMS&#x27;</span>,</span><br><span class="line">                                                <span class="string">&#x27;5R_mean&#x27;</span>, <span class="string">&#x27;5R_SDNN&#x27;</span>, <span class="string">&#x27;5R_SDSD&#x27;</span>, <span class="string">&#x27;5NN50&#x27;</span>, <span class="string">&#x27;5pNN50&#x27;</span>, <span class="string">&#x27;5NN20&#x27;</span>, <span class="string">&#x27;5pNN20&#x27;</span>,</span><br><span class="line">                                                <span class="string">&#x27;5R_RMSSD&#x27;</span>,</span><br><span class="line">                                                <span class="string">&#x27;5R_median&#x27;</span>, <span class="string">&#x27;5R_NUM&#x27;</span>, <span class="string">&#x27;5R_CVSD&#x27;</span>, <span class="string">&#x27;5R_CV&#x27;</span>, <span class="string">&#x27;5HR_mean&#x27;</span>, <span class="string">&#x27;5HR_max&#x27;</span>,</span><br><span class="line">                                                <span class="string">&#x27;5HR_min&#x27;</span>, <span class="string">&#x27;5HR_std&#x27;</span>,</span><br><span class="line">                                                <span class="string">&#x27;5LF&#x27;</span>, <span class="string">&#x27;5HF&#x27;</span>, <span class="string">&#x27;5LF_HF&#x27;</span>, <span class="string">&#x27;5LFnu&#x27;</span>, <span class="string">&#x27;5HFnu&#x27;</span>, <span class="string">&#x27;5total&#x27;</span>, <span class="string">&#x27;5VLF&#x27;</span>, <span class="string">&#x27;5sd1&#x27;</span>,</span><br><span class="line">                                                <span class="string">&#x27;5sd2&#x27;</span>, <span class="string">&#x27;5sd2/sd1&#x27;</span>,</span><br><span class="line">                                                <span class="string">&#x27;5csi10&#x27;</span>, <span class="string">&#x27;5csi30&#x27;</span>, <span class="string">&#x27;5csi50&#x27;</span>, <span class="string">&#x27;5csi100&#x27;</span>, <span class="string">&#x27;5cvi&#x27;</span>,</span><br><span class="line">                                                <span class="string">&#x27;5Modified_CSI10&#x27;</span>, <span class="string">&#x27;Modified_CSI30&#x27;</span>, <span class="string">&#x27;5Modified_CSI50&#x27;</span>,</span><br><span class="line">                                                <span class="string">&#x27;5Modified_CSI100&#x27;</span>,</span><br><span class="line">                                                <span class="string">&#x27;5apen&#x27;</span>, <span class="string">&#x27;5spen&#x27;</span>, <span class="string">&#x27;5lle&#x27;</span>, <span class="string">&#x27;5sampen&#x27;</span></span><br><span class="line">                                                ])</span><br><span class="line"></span><br><span class="line">    feature.to_excel(<span class="string">&#x27;features_&#x27;</span> + <span class="string">&#x27;%s&#x27;</span> % text + <span class="string">&quot;.xlsx&quot;</span>)</span><br><span class="line"></span><br><span class="line"></span><br></pre></td></tr></table></figure>



<p>提取ucddb库中的特征</p>
<p><img src="https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1597915592110&di=d69e7743638ac17f56976caf4b0e83d1&imgtype=0&src=http://dingyue.ws.126.net/2019/04/19/445680d311804acda2495d4ef5f31d88.jpeg"></p>

    </div>
</article>


                </div>
                <aside class="col-md-4 gal-left" id="sidebar">
    <!-- 此为sidebar的搜索框, 非搜索结果页面 -->
<aside id="sidebar-search">
    <div class="search hidden-xs" data-aos="fade-up" data-aos-duration="2000">
        <form class="form-inline clearfix" id="search-form" method="get"
              action="/search/index.html">
            <input type="text" name="s" class="form-control" id="searchInput" placeholder="搜索文章~" autocomplete="off">
            <button class="btn btn-danger btn-gal" type="submit">
                <i class="fa fa-search"></i>
            </button>
        </form>
    </div>
</aside>
    <aside id="sidebar-author">
    <div class="panel panel-gal" data-aos="flip-right" data-aos-duration="3000">
        <div class="panel-heading" style="text-align: center">
            <i class="fa fa-quote-left"></i>
            esy
            <i class="fa fa-quote-right"></i>
        </div>
        <div class="author-panel text-center">
            <img src="/imgs/avatar.jpg" width="140" height="140"
                 alt="个人头像" class="author-image">
            <p class="author-description"><p>esy</p>
</p>
        </div>
    </div>
</aside>
    
    <aside id="sidebar-recent_comments">
    <div class="panel panel-gal recent hidden-xs" data-aos="fade-up" data-aos-duration="2000">
        <div class="panel-heading">
            <i class="fa fa-comments"></i>
            最新评论
            <i class="fa fa-times-circle panel-remove"></i>
            <i class="fa fa-chevron-circle-up panel-toggle"></i>
        </div>
        <ul class="list-group list-group-flush"></ul>
    </div>
</aside>
    
    <!-- 要配置好leancloud才能开启此小工具 -->
    
    
    <aside id="sidebar-recent_posts">
    <div class="panel panel-gal recent hidden-xs" data-aos="fade-up" data-aos-duration="2000">
        <div class="panel-heading">
            <i class="fa fa-refresh"></i>
            近期文章
            <i class="fa fa-times-circle panel-remove"></i>
            <i class="fa fa-chevron-circle-up panel-toggle"></i>
        </div>
        <ul class="list-group list-group-flush">
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/11/05/python%20work/%E6%9C%80%E5%B0%8F%E4%BA%8C%E4%B9%98%E6%B3%95/">最小二乘法</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/11/05/python%20work/%E7%BB%9F%E8%AE%A1%E5%AD%A6%E4%B9%A0-%E7%AC%AC%E4%B8%80%E7%AB%A0/">统计学习--第一章</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/11/04/python%20work/hello-world/">Hello World</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/11/03/python%20work/%E5%88%86%E7%B1%BB%E6%A8%A1%E5%9E%8B%E7%9A%84%E8%AF%84%E4%BC%B0%E6%8C%87%E6%A0%87/">分类模型的评估指标</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/10/21/python%20work/10-21-%E7%88%AC%E8%99%AB%E5%9F%BA%E7%A1%80/">10-21 爬虫基础</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/09/25/python%20work/CRF%E7%9A%84%E6%95%B4%E4%BD%93%E6%B5%81%E7%A8%8B%E7%BB%93%E6%9E%9C/">CRF的整体流程结果</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/09/25/python%20work/nlp-crf%E6%A8%A1%E5%9E%8B/">nlp_crf模型</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/09/25/python%20work/%E6%95%B0%E5%AD%A6%E5%BB%BA%E6%A8%A1%E9%97%AE%E9%A2%983/">数学建模问题3</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/09/25/python%20work/%E6%95%B0%E5%AD%A6%E5%BB%BA%E6%A8%A1%E9%97%AE%E9%A2%982/">数学建模问题2</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/09/25/python%20work/%E6%95%B0%E5%AD%A6%E5%BB%BA%E6%A8%A1%E9%97%AE%E9%A2%981/">数学建模问题1</a>
                </span>
            </li>
            
        </ul>
    </div>
</aside>
    
    
    <aside id="sidebar-rand_posts">
    <div class="panel panel-gal recent hidden-xs" data-aos="fade-up" data-aos-duration="2000">
        <div class="panel-heading">
            <i class="fa fa-refresh"></i>
            随机文章
            <i class="fa fa-times-circle panel-remove"></i>
            <i class="fa fa-chevron-circle-up panel-toggle"></i>
        </div>
        <ul class="list-group list-group-flush">
            
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/08/08/python%20work/chatbot-%E7%89%88%E6%9C%AC1%E6%80%BB%E7%BB%93/">chatbot_版本1总结</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/08/18/python%20work/edf%E6%96%87%E4%BB%B6%E4%B8%AD%E7%9A%84%E6%95%B0%E6%8D%AE%E8%AF%BB%E5%8F%96/">edf文件中的数据读取</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/01/07/python%20work/matlab%E4%B8%AD%E7%9A%84%E6%BB%91%E5%8A%A8%E7%AA%97%E5%8F%A3/">matlab中的滑动窗口</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/03/08/python%20work/python%E2%80%94%E2%80%94OpenCV%E5%88%9D%E6%8E%A5%E8%A7%A6/">python——OpenCV初接触</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/02/08/python%20work/python%E2%80%94%E2%80%94%E6%BB%91%E5%8A%A8%E5%88%87%E7%89%87%E4%B9%8B%E6%95%B0%E7%BB%84/">python——滑动切片之数组</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/06/29/python%20work/%E4%B8%AD%E6%9C%9F%E7%AD%94%E8%BE%A9%E9%A2%98%E7%9B%AE/">中期答辩题目</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/11/05/python%20work/%E6%9C%80%E5%B0%8F%E4%BA%8C%E4%B9%98%E6%B3%95/">最小二乘法</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/07/10/python%20work/%E8%81%8A%E5%A4%A9%E6%9C%BA%E5%99%A8%E4%BA%BA%E5%9F%BA%E7%A1%80/">聊天机器人基础</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/06/18/python%20work/%E9%87%8D%E8%A6%81%E7%89%B9%E5%BE%81%E6%9F%A5%E7%9C%8B/">重要特征查看</a>
                </span>
            </li>
            
            <li class="list-group-item">
                <span class="post-title">
                    <a href="/2020/06/08/python%20work/HRV%E7%9A%8430s%E7%89%B9%E5%BE%81%E6%8F%90%E5%8F%96/">HRV的30s特征提取</a>
                </span>
            </li>
            
        </ul>
    </div>
</aside>
    
    
    <aside id="gal-sets">
        <div class="panel panel-gal hidden-xs" data-aos="fade-up" data-aos-duration="2000">
            <ul class="nav nav-pills pills-gal">

                
                <li>
                    <a href="/2020/08/19/python%20work/%E5%AF%B9UCDDB%E6%95%B0%E6%8D%AE%E5%BA%93%E8%BF%9B%E8%A1%8C%E7%89%B9%E5%BE%81%E6%8F%90%E5%8F%96/index.html#sidebar-tags" data-toggle="tab" id="tags-tab">热门标签</a>
                </li>
                
                
                <li>
                    <a href="/2020/08/19/python%20work/%E5%AF%B9UCDDB%E6%95%B0%E6%8D%AE%E5%BA%93%E8%BF%9B%E8%A1%8C%E7%89%B9%E5%BE%81%E6%8F%90%E5%8F%96/index.html#sidebar-friend-links" data-toggle="tab" id="friend-links-tab">友情链接</a>
                </li>
                
                
                <li>
                    <a href="/2020/08/19/python%20work/%E5%AF%B9UCDDB%E6%95%B0%E6%8D%AE%E5%BA%93%E8%BF%9B%E8%A1%8C%E7%89%B9%E5%BE%81%E6%8F%90%E5%8F%96/index.html#sidebar-links" data-toggle="tab" id="links-tab">个人链接</a>
                </li>
                
            </ul>
            <div class="tab-content">
                
                <div class="cloud-tags tab-pane nav bs-sidenav fade" id="sidebar-tags">
    
    <a href="/tags/py-study/" style="font-size: 8.11781520755309px;" class="tag-cloud-link">py_study</a>
    
    <a href="/tags/nlp/" style="font-size: 9.93434052185168px;" class="tag-cloud-link">nlp</a>
    
    <a href="/tags/Graduation-work/" style="font-size: 9.351375887590283px;" class="tag-cloud-link">Graduation work</a>
    
    <a href="/tags/work/" style="font-size: 12.69830797055352px;" class="tag-cloud-link">work</a>
    
    <a href="/tags/hexo/" style="font-size: 10.444279622979725px;" class="tag-cloud-link">hexo</a>
    
    <a href="/tags/%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2%E6%90%AD%E5%BB%BA/" style="font-size: 9.972357001452576px;" class="tag-cloud-link">-个人博客搭建</a>
    
    <a href="/tags/malab-%E6%AF%95%E4%B8%9A/" style="font-size: 13.942576950085797px;" class="tag-cloud-link">-malab -毕业</a>
    
    <a href="/tags/python-%E4%BA%BA%E5%B7%A5%E6%99%BA%E8%83%BD/" style="font-size: 15.057369364556884px;" class="tag-cloud-link">-python -人工智能</a>
    
    <a href="/tags/python/" style="font-size: 16.779992090685813px;" class="tag-cloud-link">python</a>
    
    <a href="/tags/python/" style="font-size: 9.675582489890525px;" class="tag-cloud-link">-python</a>
    
    <a href="/tags/mathematical-modeling/" style="font-size: 9.309217708856846px;" class="tag-cloud-link">mathematical modeling</a>
    
    <a href="/tags/statistical-learning/" style="font-size: 8.249256951770175px;" class="tag-cloud-link">statistical learning</a>
    
</div>
                
                
                <div class="friend-links tab-pane nav bs-sidenav fade" id="sidebar-friend-links">
    
    <li>
        <a href="http://kdays.net/days/" target="_blank">KDays Forum</a>
    </li>
    
    <li>
        <a href="http://www.gal123.com/" target="_blank">绅士导航♂</a>
    </li>
    
    <li>
        <a href="http://www.moe123.com/" target="_blank">萌导航</a>
    </li>
    
</div>
                
                
                <div class="links tab-pane nav bs-sidenav fade" id="sidebar-links">
    
    <li>
        <a href="https://github.com/ZEROKISEKI/" target="_blank">Github</a>
    </li>
    
    <li>
        <a href="https://coding.net/u/SORA1" target="_blank">Coding</a>
    </li>
    
    <li>
        <a href="https://www.zhihu.com/people/aonosora/activities" target="_blank">知乎</a>
    </li>
    
</div>
                
            </div>
        </div>
    </aside>
    
</aside>
            </div>
        </div>
    </div>
    <footer id="gal-footer">
    <div class="container">
        Copyright © 2018 esy Powered by <a href="https://hexo.io/" target="_blank">Hexo</a>.&nbsp;Theme by <a href="https://github.com/ZEROKISEKI" target="_blank">AONOSORA</a>
    </div>
</footer>

<!-- 回到顶端 -->
<div id="gal-gotop">
    <i class="fa fa-angle-up"></i>
</div>
</body>

<script src="/js/activate-power-mode.js"></script>

<script>

    // 配置highslide
	hs.graphicsDir = '/js/highslide/graphics/'
    hs.outlineType = "rounded-white";
    hs.dimmingOpacity = 0.8;
    hs.outlineWhileAnimating = true;
    hs.showCredits = false;
    hs.captionEval = "this.thumb.alt";
    hs.numberPosition = "caption";
    hs.align = "center";
    hs.transitions = ["expand", "crossfade"];
    hs.lang.number = '共%2张图, 当前是第%1张';
    hs.addSlideshow({
      interval: 5000,
      repeat: true,
      useControls: true,
      fixedControls: "fit",
      overlayOptions: {
        opacity: 0.75,
        position: "bottom center",
        hideOnMouseOut: true
      }
    })

    // 初始化aos
    AOS.init({
      duration: 1000,
      delay: 0,
      easing: 'ease-out-back'
    });

</script>
<script>
	POWERMODE.colorful = 'true';    // make power mode colorful
	POWERMODE.shake = 'true';       // turn off shake
	// TODO 这里根据具体情况修改
	document.body.addEventListener('input', POWERMODE);
</script>
<script>
    window.slideConfig = {
      prefix: '/imgs/slide/background',
      ext: 'jpg',
      maxCount: '6'
    }
</script>

<script src="/js/hs.js"></script>
<script src="/js/blog.js"></script>



<script src="/js/oni.js"></script>




</html>